import requests
from config import url_cloud,headers_web

class LearningMaterialFiles:
    def __int__(self):
        self.url = url_cloud
        self.headers = headers_web

    @classmethod
    def post_saveMaterialFiles(cls,url_cloud: str,headers= headers_web, params= None, json= None):
        '''
        summary:保存实验室学习资料文件
        description:"1.云课堂管理端"
        :param url:
        :param headers:
        :param params:
        :param json:
        :return:
        '''
        url = url_cloud + "/teachinglaboratoryapi/v1/laboratorylearningmaterialfiles"
        r = requests.post(url= url,headers= headers,params= params,json= json)
        return r

    @classmethod
    def get_referMaterialFiles(cls,url_cloud: str,headers= headers_web, params= None):
        '''
        summary:查询实验室学习资料文件
        description:"1.云课堂管理端"
        :param url_cloud:
        :param headers:
        :param params:
        :return:
        '''
        url = url_cloud + "/teachinglaboratoryapi/v1/laboratorylearningmaterialfiles"
        r = requests.get(url= url,headers= headers,params= params)
        return r

    @classmethod
    def get_materialFilesInfo(cls,url_cloud: str,headers= headers_web, params= None,paramspath= None):
        '''
        summary:获取学生学习资料文件信息以及情况
        description:1.云课堂学生端
        :param url_cloud:
        :param headers:
        :param params:
        :return:
        '''
        url = url_cloud + f"/teachinglaboratoryapi/v1/laboratorylearningmaterialfiles/{paramspath}/learning"
        r = requests.get(url=url, headers=headers, params=params)
        return r